package com.t11;

import typeinfo.pets.Pet;

import java.util.Iterator;

/**
 * Created by xuyiwei on 2018/7/22.
 */
public class NonCollectionSequeue {
    private Pet[] pets;
    public NonCollectionSequeue(Pet[] pets) {
        this.pets = pets;
    }
    public Iterator<Pet> iterator(){
        return new Iterator<Pet>() {
            public int i = 0;
            @Override
            public boolean hasNext() {
                return i<pets.length;
            }

            @Override
            public Pet next() {
                return pets[i++];
            }
        };
    }

    public static void main(String[] args) {
        String [] strs = {"2","1","3"};
        int i = 0;
        System.out.println(strs[i++]);
    }
}
